package com.atguigu.cmsservice.controller;

import com.atguigu.cmsservice.entity.CrmBanner;
import com.atguigu.cmsservice.service.CrmBannerService;
import com.atguigu.commonutils.R;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.security.acl.LastOwnerException;
import java.util.List;

/**
 * @author fxy
 * @date 2022/5/10 11:21
 * 管理员前台
 */
@RestController
//@CrossOrigin
@RequestMapping("/cmsservice/bannerfront")
public class BannerFrontController {

    @Autowired
    private CrmBannerService bannerService;

    //要把数据存到redis中
    @GetMapping("/getAllBanner")
    public R index() {
        List<CrmBanner> list = bannerService.selectAllBanner();
        return R.ok().data("list", list);
    }
}
